using AgileBoard.Core;
using FluentNHibernate.Automapping;
using FluentNHibernate.Automapping.Alterations;

namespace AgileBoard.Infrastructure.NHibernateMaps
{
    public class StateMapping : IAutoMappingOverride<State>
    {
        #region IAutoMappingOverride<State> Members

        public void Override(AutoMapping<State> mapping)
        {
            mapping.References(x => x.Project);

            mapping.References(x => x.Iteration);
            mapping.HasMany(x => x.Stories)
                .Inverse()
                .Cascade.All();
        }

        #endregion
    }
}